import React, { PureComponent } from 'react'
import { increAction } from '../store/actionCreators'
import { connect, connectMX } from '../utils'
function Home(props) {
  return (
    <>
      <h1>home中当前计数{props.counter}</h1>
      <button onClick={() => props.incrementClick()}>Home + 1</button>
    </>
  )
}
const mapStateToProps = state => ({ counter: state.counter })
const mapDispachToprops = dispatch => {
  return {
    incrementClick: function () {
      dispatch(increAction())
    },
  }
}
export default connect(mapStateToProps, mapDispachToprops)(Home)
// export default connectMX(mapStateToProps, mapDispachToprops)(Home)
